#include <iostream>
#include <vector>
using namespace std;
using V_size = vector<string>::size_type;
using Iter = vector<string>::iterator;

// 第一种方法
void printVector(const vector<string>& v, V_size idx) {
    if (idx == v.size()) {
        cout << endl;
        return;
    }

    cout << v[idx] << " ";
    printVector(v, idx+1);
}

// 第二种方法
void printVector2(Iter begin, Iter end) {
    if (begin == end) {
        cout << endl;
        return;
    }

    cout << *begin << " ";
    printVector2(begin+1, end);
}

int main() {
    vector<string> v = { "Hello", "World", "Mango", "GO" };
    printVector(v, 0); // Hello World Mango GO 
    printVector(v, 2); // Mango GO

    printVector2(v.begin(), v.end());    // Hello World Mango GO
    printVector2(v.begin() + 2, v.end());// Mango GO
}